using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Sheep_Breeding.Domain.production_b
{
    /// <summary>
    /// 羊只销售实体类
    /// </summary>
    [Table("sheep_sale")]
    public class SheepSale
    {
        [Key]
        [Column("id")]
        public long Id { get; set; } // 主键

        [Column("sale_date")]
        public DateTime? SaleDate { get; set; } // 销售日期

        [ForeignKey("Customer")]
        [Column("customer_id")]
        public long? CustomerId { get; set; } // 客户


    

        [ForeignKey("User")]
        [Column("salesman_id")]
        public long? SalesmanId { get; set; } // 销售员




        [Column("order_number")]
        [StringLength(50)]
        public string? OrderNumber { get; set; } // 单据号

        [Column("address")]
        [StringLength(200)]
        public string? Address { get; set; } // 收货地址

        [Column("serial_number")]
        [StringLength(50)]
        public string? SerialNumber { get; set; } // 流水号

        [Column("ear_number")]
        [StringLength(50)]
        public string? EarNumber { get; set; } // 耳号

        [Column("transaction_price")]
        public decimal? TransactionPrice { get; set; } // 成交价

        [Column("fixed_price")]
        public decimal? FixedPrice { get; set; } // 定价

        [Column("discount_rate")]
        public decimal? DiscountRate { get; set; } // 折扣比例

        [Column("grade")]
        [StringLength(20)]
        public string? Grade { get; set; } // 等级

        [Column("breed")]
        [StringLength(50)]
        public string? Breed { get; set; } // 品种

        [Column("gender")]
        [StringLength(10)]
        public string? Gender { get; set; } // 性别

        [ForeignKey("SheepType")]
        [Column("sheep_type_id")]
        public long? SheepTypeId { get; set; } // 羊只类型


        [Column("status")]
        [StringLength(20)]
        public string? Status { get; set; } // 羊只状态

        [ForeignKey("Pen")]
        [Column("pen_id")]
        public string? PenId { get; set; } // 栏位


        [Column("birth_date")]
        public DateTime? BirthDate { get; set; } // 出生日期

        [Column("birth_weight")]
        public decimal? BirthWeight { get; set; } // 出生重

        [Column("weaning_weight")]
        public decimal? WeaningWeight { get; set; } // 断奶重

        [Column("father_number")]
        [StringLength(50)]
        public string? FatherNumber { get; set; } // 父号

        [Column("mother_number")]
        [StringLength(50)]
        public string? MotherNumber { get; set; } // 母号

        [Column("month_age")]
        public int? MonthAge { get; set; } // 月龄

        [Column("remark")]
        [StringLength(500)]
        public string? Remark { get; set; } // 备注
    [ForeignKey("User")]
        [Column("create_user_id")]
        public string? CreateUserId { get; set; } // 创建人

        [Column("create_time")]
        public DateTime? CreateTime { get; set; } // 创建时间
              [ForeignKey("User")]
        [Column("update_user_id")]
        public string? UpdateUserId { get; set; } // 修改人


        [Column("update_time")]
        public DateTime? UpdateTime { get; set; } // 更新时间
        [ForeignKey("User")]
        [Column("approval_user_id")]
        public string? ApprovalUserId { get; set; } // 审核人


        [Column("approval_time")]
        public DateTime? ApprovalTime { get; set; } // 审核时间

        [ForeignKey("User")]
        [Column("finance_approval_user_id")]
        public string? FinanceApprovalUserId { get; set; } // 财务审核人


        [Column("finance_approval_time")]
        public DateTime? FinanceApprovalTime { get; set; } // 财务审核时间

        [ForeignKey("User")]
        [Column("warehouse_approval_user_id")]
        public string? WarehouseApprovalUserId { get; set; } // 仓库审核人


        [Column("warehouse_approval_time")]
        public DateTime? WarehouseApprovalTime { get; set; } // 仓库审核时间

        [Column("is_deleted")]
        public bool IsDeleted { get; set; } = false; // 逻辑删除标记
    }
} 